package com.lsq.lwf.common.utils;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

public class ActualInterface {

	@SuppressWarnings("rawtypes")
	public static Class getInterfaceActualClass(Class cla, int index) {
		Type type = cla.getGenericSuperclass();
		ParameterizedType pt = (ParameterizedType) type;
		Type[] t = pt.getActualTypeArguments();
		if (t != null && index >= 0) {
			return (Class) t[index];
		}
		return Object.class;
	}
}
